<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var user=prompt("请输入您的用户名:");			
			var reg=/^([\u4e00-\u9fa5]{1,4}|[A-Za-z]{1,8})$/;			
			console.log(reg.test(user));
		</script>
	</body>
</html>
